home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / printing / bjf-1.000 / bjf-1 / bjf / README < prev   
Text File  |  1994-02-27  |  10KB  |  270 lines

  1. === Intro ==============================
  2.  
  3. bjf is a filter for Canon BJ-200 printers.  It does:
  4.  
  5.   1-sided or manual 2-sided
  6.   1-up, 2-up or 4-up, or landscape
  7.   draft or letter quality (i.e., gray or black)
  8.   resident font selection (courier,gothic,prestige) x (10,12,17,proportional)
  9.   vertical & horizontal margins
  10.  
  11. More specifically:
  12.  
  13. Without some help, the BJ200 is pretty useless.  "lpr file.txt" produces
  14. pages in reverse order, prints over page breaks (omitting 3 lines every
  15. time), positions the output over the holes in 3-hole paper (getting ink
  16. all over the platen and smudging subsequent sheets), etc, etc.
  17.  
  18. bjf shoves in escape sequences to provide access to advanced features
  19. like not dropping the data.  Also page size, fonts, line spacing, and so on.
  20.  
  21. It probably works with compatible Canon printers, but will not work
  22. with a vanilla Proprinter -- it uses Canon-only codes to download
  23. 360x360 characters.  In modes that use only resident fonts, it might
  24. work with Proprinters.
  25.  
  26. The printer must be in Proprinter mode (DIP switch 12 off).  Epson mode
  27. has more fonts and better ones, but does not have 360x360 resolution.
  28.  
  29. All characters print (using the IBM PC character set) except (only) these:
  30.  
  31.     \r  carriage return
  32.     \n  newline
  33.     \t  tab
  34.     \f  formfeed
  35.     \b  backspace    
  36.  
  37. Note particularly that escape \033 is NOT in this list, so preformatted files
  38. containing escape sequences will have their escape sequences printed out.
  39.  
  40. Also note that linefeed is treated as Unix newline, which also works
  41. for CRLF-delimited lines.  But a file that improbably depends on
  42. linefeed not performing carriage return won't print correctly.
  43.  
  44. There are many flags, sorry.  A few of them are useless, provided only
  45. to give access to some seldom-used escape sequence.
  46.  
  47.  
  48. === About 1-sided and 2-sided printing ==============================
  49.  
  50. By default bjf prints 1-sided.  It prints the last page first so the
  51. output ends up with the first page on top.
  52.  
  53. For 2-sided printing, there are two flags, -even and -odd.  First
  54. print the file with -odd.  Put the output back into the printer, top
  55. edge down with the blank side forward.  Print the file again with
  56. -even.  [ Mnemonic: first print page 1 etc, then print page 2 etc. ]
  57.  
  58. -even and -odd can be used with all other options.
  59.  
  60.  
  61. === About draft mode ==============================
  62.  
  63. Use -draft to get gray instead of black printing.  This saves ink and
  64. prints faster.  By default, output is letter quality, i.e., black.
  65.  
  66. -draft can be used with all other options except -font.
  67.  
  68.  
  69. === About resident fonts ==============================
  70.  
  71. Resident fonts come in 3 faces.  The default is Courier.
  72.  
  73.     face     beauty?    flag
  74.  
  75.     courier      pass        -font courier
  76.     prestige      not        -font prestige
  77.     sans      not        -font gothic
  78.  
  79. Resident fonts come in 4 widths, given in chars/inch.  The number of
  80. chars per line depends on this character pitch.
  81.  
  82.     pitch    max width    typical width   flag
  83.     
  84.     10 cpi       80            65        -cpi 10
  85.     12 cpi       96            80        -cpi 12
  86.     17 cpi      137           132        -cpi 17
  87.  proportional     varies            80        -cpi ps
  88.  
  89. Resident fonts all are the same height, designed to print 6 lines per inch,
  90. so an 11-inch page is 66 lines high.  The top line and bottom two lines
  91. can't be printed.
  92.  
  93. Horizontal and vertical margins are not specified directly, instead
  94. the page width and height are given.  Margins are chosen to center the
  95. printable area on the paper.
  96.  
  97. So, for example, -width 80 -height 60 -cpi 12 is a normal setting, producing
  98. pages 80 cols wide, 60 lines high, with about 1-inch margins left and right
  99. and about 1/2 inch top and bottom.
  100.  
  101. Lines longer than -width are truncated.  Pages taller than -height are
  102. continued on the next page.
  103.  
  104. Owing to the extreme weirdness of old line printers and the conventions
  105. that grew up around them, documents are sometimes formatted assuming that
  106. a page is 66 lines high and that linefeeds should be used to advance the
  107. paper to the next page.  -height 66 accommodates this.  Pages of 66 lines
  108. are centered on the paper, meaning that the top and bottom margins are
  109. zero.  Note that the BJ-200 does not print the top line and bottom two
  110. lines on the paper -- my original reason for writing this -- so use
  111. -height 66 only when the document has been formatted by a utility that
  112. insures those lines are always blank.  (Like pr(1).)
  113.  
  114. To vertically center the output on the paper, bjf must know how long
  115. the paper is.  If it is not 11 inches, use the -paper-length flag
  116. to give the length in inches.  (It's floating point, i.e. it can
  117. have a fractional part.)
  118.  
  119. To get double-spaced output or something equally strange, use the
  120. flag -lpi to set the desired number of lines per inch.  This doesn't
  121. change the size of the characters, of course, just the line spacing.
  122. It too is floating point.
  123.  
  124. Resident fonts come in two code pages, 437 and 850.  Use -code-page to
  125. say which.  The default is 437.  Code page 850 has some different
  126. national characters in the high half of the chart, see your favorite IBM
  127. documentation for details.
  128.  
  129. All the flags in this section can be used freely with each other, but
  130. not with the flags in the next section.
  131.  
  132.  
  133. === About downloaded fonts ==============================
  134.  
  135. bjf does not download arbitrary fonts, but has some built in tiny fonts
  136. for special effects.
  137.  
  138. It can print two or four pages per side, or print sideways (landscape).
  139.  
  140.     flag       width          height
  141.             default max    default max
  142.  
  143.  -two-up      80    83       60       77
  144.  -four-up     80    82       60    76
  145.  -landscape  132   137       60    64
  146.  
  147. The flags -width, -height, and -paper-length control the page size and
  148. centering, as with device fonts.  The above maximums are for 11-inch
  149. paper, other lengths will change the max width or height.
  150.  
  151. Since these fonts are so small, bjf prints two lines at a time.  This
  152. means sending vast amounts of data to the printer.  Print speed is
  153. limited by the data rate -- there will be some pauses in printing, but
  154. it is still printing faster than if it only did one line at a time.
  155.  
  156.  
  157. === Man page ==============================
  158.  
  159. Usage is
  160.     bjf -flags < infile > outfile
  161.  
  162. bjf is an lpd input filter -- it only reads from stdin, which must be
  163. a disk file.
  164.  
  165. It's meant to be run from scripts, so there is no provision for changing
  166. defaults in the makefile or other handy config utility.  Just specify
  167. the necessary flags in the scripts.
  168.  
  169.    -width N positions the printout to center a line of length N chars.
  170.      For proportional fonts, N is taken in 12 cpi units.  Long lines are
  171.      truncated at the right edge of the print area, which may be more
  172.      than N chars.
  173.  
  174.    -height N prints N lines per page, positioned to vertically center
  175.      a full page of N lines.  -height 66 specifies the whole sheet, and
  176.      the printout is positioned accordingly, but lines 1,65,66 are not
  177.      printable and are not sent.  This is what is needed for pr and
  178.      nroff output using 66 lines/page instead of formfeeds.
  179.  
  180.    -cpi N, N in { 10 12 17 PS }, chooses a font of that pitch in chars/in.
  181.  
  182.    -lpi N.N sets the interline spacing to N.N lines/in.  Default 6.
  183.  
  184.    -font X, X in { courier, gothic, prestige }, uses that resident font.
  185.      courier is the default, and best.  Can't be used with -draft,
  186.      -landscape, -two-up, -four-up.
  187.  
  188.    -code-page N, N in { 437, 850 }, uses that code page.  Default 437.
  189.      Conflicts with -landscape, -two-up, -four-up.
  190.  
  191.    -paper-length N.N gives the height of the physical paper in inches.
  192.  
  193.    -draft uses draft mode (light ink, high speed) output.
  194.      There's only one draft font, so -draft and -font conflict.
  195.  
  196.    -landscape downloads a sideways font and rotates the page.  
  197.      Size is typically 132x60.  Conflicts with -font but not -draft.
  198.  
  199.    -two-up prints two pages side by side.  Implies -landscape.
  200.      Size is typically 80x60.  (WIDTH is the width of one of the two pages.)
  201.  
  202.    -four-up prints four pages per sheet. Conflicts with -font and -landscape.
  203.  
  204.    -odd prints every other sheet starting at the first.
  205.  
  206.    -even prints every other sheet starting at the second, followed by
  207.      a blank page if the last sheet was not even.
  208.  
  209.  
  210. === DIP switch settings ==============================
  211.  
  212.     1    any   off = letter, on = A4  (sets width, -paper-length sets length)
  213.     2    off
  214.     3    ignored
  215.     4    ignored        
  216.     5    ignored
  217.     6    ignored
  218.     7    ignored
  219.     8    ignored
  220.     9    ignored
  221.    10    on
  222.    11    ignored
  223.    12    off
  224.  
  225.  
  226. === /etc/printcap ==============================
  227.  
  228. I am no expert, and will offer no advice to people contemplating
  229. complicated setups.  But I will tell you what I did.
  230.  
  231. I use printer names to encode useful flag combinations.  For example,
  232. to print something two-up with ordinary margins, I would use
  233.  
  234.     lpr -P80x60x2 file.txt
  235.  
  236. My printcap defines a large number of these 'printers', like this:
  237.  
  238.     80x60:if=/usr/etc/bjf80x60:tc=raw:
  239.     65x60:if=/usr/etc/bjf65x60:tc=raw:
  240.     80x66:if=/usr/etc/bjf80x66:tc=raw:
  241.     65x66:if=/usr/etc/bjf75x66:tc=raw:
  242.     80x60x2:if=/usr/etc/bjf80x60x2:tc=raw:
  243.     80x60x4:if=/usr/etc/bjf80x60x4:tc=raw:
  244.     80x76x2:if=/usr/etc/bjf80x76x2:tc=raw:
  245.     80x76x4:if=/usr/etc/bjf80x76x4:tc=raw:
  246.  
  247. 'raw' is the real printer, which just passes the data straight through:
  248.  
  249.     raw:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:
  250.  
  251. The filter scripts /usr/etc/bjfxxxxx are all something like
  252.  
  253.     #!/bin/sh
  254.     exec /usr/etc/bjf -width 80 -height 60 -two-up -draft
  255.  
  256. You can bang out the filter scripts (and the printcap entries) by the
  257. gross with a trivial Icon (or, if you insist, perl) program.  Just
  258. come up with a consistent, memorable representation for the main
  259. options: size, 1side/even/odd, draft/letter.
  260.  
  261. For occasional special cases, run it by hand with
  262.  
  263.       bjf -flags < file | lpr
  264. or    bjf -flags < file > /dev/lp1
  265.  
  266.  
  267. === BUGS ==============================
  268.  
  269. The lancscape font is missing some chars.  It's basically ASCII-7, not IBMPC.
  270.